package cn.crce.cloud9.basic;

/**
 * @author OnCloud9
 * @description
 * @project NRCE-TEST
 * @date 2022年09月10日 上午 12:18
 */
public class Case39 {
    public static void main(String[] args){
        //**************found*****************
        int[] arrayOfInts = { 33, 88, 5, 458, 18, 107, 200, 8, 622, 127 };
        int searchfor = 18;

        int i = 0;
        //**************found*****************
        boolean foundIt = false;

        for ( ; i<arrayOfInts.length; i++){
            //**************found*****************
            if (arrayOfInts[i] == searchfor ){
                foundIt = true;
                //**************found*****************
                break;
            }
        }

        if (foundIt) {
            System.out.println("Found " + searchfor + " at index " + i);
        } else {
            System.out.println(searchfor + "not in the array");
        }
    }
}
